﻿// DiskMemoryDLL.cpp
#include "pch.h"
#include "DiskMemoryDLL.h"
#include <windows.h>

using namespace DiskMemoryDLL;
using namespace Platform;

WindowsPhoneRuntimeComponent::WindowsPhoneRuntimeComponent()
{

}
bool DiskLibrary::GetFreeDiskSpace(Platform::String^ dir, uint64 *pAvailable, uint64 *pBytes, uint64 *pTotalAvailable)
{
       *pAvailable = *pBytes = *pTotalAvailable = 0;
       ULARGE_INTEGER available, bytes, totalAvailable;
	   if (GetDiskFreeSpaceExW(dir->Data(), &available, &bytes, &totalAvailable))
	   {
             *pAvailable = available.QuadPart;
             *pBytes = bytes.QuadPart;
             *pTotalAvailable = totalAvailable.QuadPart;
             return true;
       }
       return false;
};



